#pragma once
#include "Shader.h"

namespace Graphics
{
class FadeShader : public Shader
{
	RTTI_DECLARATIONS(FadeShader, Graphics::Shader)
private:
	struct FadeBufferType
	{
		float FadeAmount;
		D3DXVECTOR3 Padding;
	};

public:
	FadeShader(void);

	virtual ~FadeShader(void);

	bool Initialize(HWND hwnd);

	void Deinitialize();

	bool Render(int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix,  
				ID3D11ShaderResourceView* texture, float fadeAmount);

private:
	bool InitializeShader(HWND winHandle, const char* vertexShaderName, const char*  pixelShaderName);

	void DeinitializeShader();

	bool SetShaderParameters(int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix,  
				ID3D11ShaderResourceView* texture, float fadeAmount);

private:
	ID3D11Buffer* mFadeBuffer;
};
}